package com.dgut.finaldemo.config;

import com.dgut.finaldemo.util.JWTInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new JWTInterceptor())
                .excludePathPatterns("/**");
                /*.addPathPatterns("/**") 卡bug，搞不懂了
                .excludePathPatterns("/loginFront","/loginEnd","/checkLogin","/login_front","/login_end","/logout");*/

    }
}
